gdkkeys-win32: Fix capslock handling
authorPhilip Zander <philip.zander@gmail.com>
Wed, 12 Jan 2022 20:17:28 +0000 (21:17 +0100)
committerLuca Bacci <luca.bacci982@gmail.com>
Wed, 12 Jan 2022 20:43:53 +0000 (21:43 +0100)
commitb0818f9535fa7944a6314df6152cee70ca5e8573
tree4b36f5970697f8beb41123b2eb30b3ba7078a4a6
parentc71cb35e9dc3cf4dc109ce64dbd7731c93018f56
gdkkeys-win32: Fix capslock handling

Previously, we treated CapsLock and KanaLock as part of the global
keyboard state, much like NumLock and ScrollLock, rather than using
the supplied modifier mask. This was because GDK does not have a
modifier mask for KanaLock, only for CapsLock, so it would not have been
possible to properly support it.

However, this approach ended up causing problems, with certain keyboard
shortcuts not registering when capslock was active. This was first
observed in Inkscape [0] and appears to affect shortcuts consisting of a
single key (like 'a') with no additional modifiers (wheareas shortcuts
like 'ctrl+a' work).

So now we are using the supplied GDK_LOCK_MASK instead, and dropped
support for KanaLock, which we probably don't need anyway (since regular
text input should be handled by the IME input module -- the keymap is
mainly for shortcuts and keybindings, where you don't really want
KanaLock).

[0] https://gitlab.com/inkscape/inkscape/-/issues/3082
gdk/win32/gdkkeys-win32-impl.c
gdk/win32/gdkkeys-win32.c
gdk/win32/gdkkeys-win32.h